import request from '../../utils/request'
const api_name = "goods"
const group_name = "oss"

/**分页查询商品 */
export function getGoodsListByCondition(queryCondition) {
    return request({
        url: `/${group_name}/${api_name}/pagequery`,
        method: 'post',
        data: queryCondition
    })
}

/**查询商品详情 */
export function getGoodsDetail(id) {
    return request({
        url: `/${group_name}/${api_name}/bookdetail/${id}`,
        method: 'get'
    })
}

/**删除商品 */
export function removeGoods(id) {
    return request({
        url: `/${group_name}/${api_name}/remove/${id}`,
        method: 'DELETE'
    })
}

/**添加商品 */
export function addGoods(goodsInfo) {
    return request({
        url: `/${group_name}/${api_name}/add`,
        method: 'POST',
        data:goodsInfo
    })
}

/**修改书籍 */
export function editGoods(goodsInfo) {
    return request({
        url: `/${group_name}/${api_name}/edit`,
        method: 'PUT',
        data:goodsInfo
    })
}